Skip to content

Comments

Include addTag and getTagValue APIs#142

Merged
anuruddhal merged 5 commits intoballerina-platform:mainfrom
NipunaMadhushan:add-get-tag-api
Oct 16, 2025
Merged

Include addTag and getTagValue APIs#142
anuruddhal merged 5 commits intoballerina-platform:mainfrom
NipunaMadhushan:add-get-tag-api

Conversation

@NipunaMadhushan
Copy link
Contributor

Purpose

This APIs are added for the ICP 2.0 implementation for observability.

wso2/integration-control-plane#22

Approach

Following APIs will be added.

  1. Add additional tag key & value pair for all the metrics and traces in the runtime.
addTag(string tagKey, string tagValue)

e.g:

_ = check observe:addTag("tagKey", "tagValue");
  1. Get the tag value if the provided tag key exists.
getTagValue(string tagKey)

e.g:

string? tagValue = observe:getTagValue("tagKey");

Examples

Checklist

  • Linked to an issue
  • Updated the changelog
  • Added tests

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds two new observability APIs to attach and retrieve tag key-value pairs at runtime to support ICP 2.0 observability.

  • Introduces native implementations for addTag and getTagValue.
  • Exposes new public isolated Ballerina functions and updates module version and language version.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/AddTag.java Native implementation to attach a tag to the current observation context.
native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/GetTagValue.java Native implementation to retrieve a tag value from the current observation context.
ballerina/natives.bal Exposes addTag and getTagValue as public isolated Ballerina functions with docs.
gradle.properties Bumps module and Ballerina language versions.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

NipunaMadhushan and others added 3 commits October 16, 2025 10:29
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@anuruddhal anuruddhal merged commit bf7ffd2 into ballerina-platform:main Oct 16, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants